#!/bin/bash

# \e
# \033
# \x1B
Fix='033'
red='\'${Fix}'[91m'
green='\'${Fix}'[92m'
yellow='\'${Fix}'[93m'
magenta='\'${Fix}'[95m'
cyan='\'${Fix}'[96m'
none='\'${Fix}'[0m'
_version='0.01'


if [ -z "$1"  ]
then
  echo "请设置命令！"
  # exit 1;
fi

# for i in {0..50};
# do 
#   echo -e '\\e['$i"m: \e["$i"m I love you\e[0m"

# done

# if [ -z "$2"   ]
# then
#   echo "sleep...？"
#   exit 1;
# fi

echo $1-$2

set +e

IPPrefix="192.168.8."
curPath=$(dirname $(readlink -f "$0"))
echo $curPath 
IFUSER=ceshi
PASSWD=$(cat $curPath/../.env)
# echo "PASSWD: " $PASSWD

#!/bin/bash


for i in {201..205} 
  # for i in $*
    do

    echo "------link--> $IPPrefix$i---------"
    # if(($i==2 || $i==34 || $i==200 || $i==14 || $i==15)); then
    #   echo "跳过 主机器..."
    #   echo "--------------------------------"
    #   echo ""
    #   continue
    # fi

    if [ -z "$2"   ]
    then
      sleep 1
    fi

    sshpass -p $PASSWD ssh -o ConnectTimeout=4 -o ConnectionAttempts=5  $IFUSER@$IPPrefix$i "$1"

    echo "--------------------------------"
    echo ""
  done